using UnityEngine;
using QFramework;
using Unity.VisualScripting;

namespace Survivor
{
	public partial class Exp : ViewController
	{
		void Start()
		{
			CollectedBox.OnTriggerEnter2DEvent(BeCollect).UnRegisterWhenGameObjectDestroyed(gameObject);
		}

		void BeCollect(Collider2D co)
		{
			if (co.GetComponent<CollectableArea>())
			{
				AudioKit.PlaySound("Exp");
				Global.GainExp();
				this.DestroyGameObjGracefully();
			}
		}
	}
}
